<?php

namespace Plugins\WebSite\Http\WWW\Controller;

use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\View\Render;
use Plugins\WebSite\Http\PageInfo;
use Psr\Http\Message\ResponseInterface;


#[Controller("/")]
class IndexController
{

    #[GetMapping("")]
    public function index(Render $render, PageInfo $pageInfo): ResponseInterface
    {
        return $render->render('index', [
            'pageInfo' => $pageInfo,
        ]);
    }

    #[GetMapping("page-{page}")]
    public function page(Render $render, PageInfo $pageInfo): ResponseInterface
    {
        return $render->render('index', [
            'pageInfo' => $pageInfo,
        ]);
    }
}